package service

import (
	"choujiang/common/models"
	"choujiang/common/db"
	"fmt"
	"choujiang/common/utils"
)

func GetPosters() []model.Poster {
	posters := make([]model.Poster, 0)
	err := db.MysqlEngine.Where("status=?", 1).Find(&posters)
	if err != nil {
		fmt.Printf("GetPosters err: %s\n", err)
	}
	for i := 0; i < len(posters); i++ {
		posters[i].Background = utils.AddPrefix(posters[i].Background)
	}
	return posters
}
